<template>
  <div class="view view-home-h5" :class="{'showFix': showFix}">
    <!-- ui data over -->
    <div class="floor floor-banner">
      <img class="full-img" :src="require('@/assets/home-h5-img/2x/矩形@2x.png')" alt />
      <div class="floor-container">
        <p class="desc">
          <span>超过</span>
          <countTo class="total" :startVal="startNum" :endVal="endNum" :duration="numDuration" />
          <span>家中小微企业的共同选择</span>
        </p>
        <img class="icon-logo" :src="require('@/assets/home-pc-img/logo.png')" alt />
      </div>
    </div>

    <!-- ui data over -->
    <div class="floor floor-login">
      <div class="card-box">
        <login-form @click-code="handleGetCode" @click-login="handleLogin"  @click-gift="handleLookPop"/>
        <div class="btn-rule" @click="showRulePop=true">活动规则</div>
      </div>
    </div>

    <div class="floor floor-resolve">
      <div class="bg floor-container"></div>
      <div class="floor-container">
        <div class="floor-title">为您提供经营解决方案</div>
        <div class="floor-desc">更好地管生意、更快地提升经营效益</div>
        <ul class="list clearfix">
          <li class="item" @click="handleLook(urlMap.ykj.url)">
            <img :src="require('@/assets/home-h5-img/2x/ic_ykj_rd@2x.png')" alt />
            <p class="title">云会计</p>
            <p>随时记账查账</p>
            <p>多人协同管账</p>
            <div class="btn is-active">免费体验</div>
          </li>
          <li class="item" @click="handleLook(urlMap.yjxc.url)">
            <img :src="require('@/assets/home-h5-img/2x/ic_yjxv_rd@2x.png')" alt />
            <p class="title">云进销存</p>
            <p>随时随地</p>
            <p>轻松管理生意</p>
            <div class="btn is-active">免费体验</div>
          </li>
          <li class="item" @click="handleLookPop">
            <img src="../../assets/home-h5-img/2x/logo_app@2x.png" alt />
            <p class="title">精斗云V5</p>
            <p>新零售解决方案</p>
            <p>财务业务一体化</p>
            <div class="btn is-active">申请免费体验</div>
          </li>
          <li class="item" @click="handleLookPop">
            <img src="../../assets/home-h5-img/2x/kkd@2x.png" alt />
            <p class="title">小程序商城</p>
            <p>社交化商业营销</p>
            <p>10分钟快速搭建</p>
            <div class="btn is-active">申请免费体验</div>
          </li>
        </ul>
      </div>
    </div>

    <!-- over -->
    <div class="floor-quality">
      <div class="floor-title">金蝶品质，26年沉淀</div>
      <div class="floor-desc">全球CSA云安全联盟成员</div>
      <ul class="list clearfix">
        <li class="item">
          <div class="box">
            <img src="../../assets/home-h5-img/2x/图标1@2x.png" alt />
            <p class="title">安全认证</p>
            <p>ISO27001国际信息安全标准认证，</p>
            <p>每年接受第三方监督审核</p>
          </div>
        </li>
        <li class="item">
          <div class="box">
            <img src="../../assets/home-h5-img/svg/图标2@1x.svg" alt />
            <p class="title">数据安全</p>
            <p>国内电信级IDC机房数据存储，容灾备份</p>
            <p>无用户授权，禁止浏览任何用户私有数据</p>
          </div>
        </li>
        <li class="item">
          <div class="box">
            <img src="../../assets/home-h5-img/svg/图标3@1x.svg" alt />
            <p class="title">操作安全</p>
            <p>手势密码设置、动态手机短信</p>
            <p>验证次数限制等</p>
          </div>
        </li>
      </ul>
    </div>

    <!-- over -->
    <div class="floor floor-custom">
      <div class="floor-title">他们都在用精斗云</div>
      <div class="floor-desc">全行业全场景适用，颠覆传统模式</div>
      <van-swipe class="list clearfix" indicator-color="white" @change="onChange" :loop="false" :autoplay="0">
        <van-swipe-item class="item">
          <img src="https://cdn.jdy.com/mjdy/images_new/index/case_1.png" alt />
          <div class="item__body">
            <div class="title">易定制</div>
            <div class="sub-title">
              <p>行业类目:服装鞋帽</p>
              <p>使用产品：云会计</p>
            </div>
            <p
              class="desc"
            >“由于我们是创业公司，我本人基本上是业务财务一起管理，以前用Excel费时费力，需要交叉核对许多数据，用了云会计之后完全不需要顾虑这些了。每日生成的分录只要核对无误，月底直接结账即可，审核速度也大大提高，云会计真是太赞了！”</p>
          </div>
        </van-swipe-item>
        <van-swipe-item class="item">
          <img alt src="https://cdn.jdy.com/mjdy/images_new/index/case_2.png" />
          <div></div>
          <div class="title">巴黎贝甜</div>
          <div class="sub-title">
            <p>行业类目：食品饮料</p>
            <p>使用产品：云进销存</p>
          </div>
          <p
            class="desc"
          >“现在通过云进销存系统就可以掌控各门店每天业务收入、成本核算、费用支出经营数据，而且各门店业务数据自动结转财务系统，实现各门店财务业务一体化管理，真是太方便了。精斗云，值得信赖。”</p>
        </van-swipe-item>
        <van-swipe-item class="item">
          <img alt src="https://cdn.jdy.com/mjdy/images_new/index/case_3.png" />
          <div class="title">大宋官窑</div>
          <div class="sub-title">
            <p>行业类目：高端工艺品</p>
            <p>使用产品：精斗云V5</p>
          </div>
          <p
            class="desc"
          >“使用精斗云V5后，门店和仓库紧密的连接在一起，库存透明化，所有门店的库存实时共享，手机APP上可以快速调拨商品，简化了业务流程，以前调货没货都要和客户解释很久，现在都不用了~客户体验都更好了。”</p>
        </van-swipe-item>
        <van-swipe-item class="item">
          <img alt src="https://cdn.jdy.com/mjdy/images_new/index/case_4.png" />
          <div>
            <div class="title">匹克体育</div>
            <div class="sub-title">
              <p>行业类目：文体用品</p>
              <p>使用产品：精斗云小程序商城</p>
            </div>
            <p
              class="desc"
            >“在线下各类场景中，小程序的植入可以起到良好的流量承接和转化，即扫即用，能为用户带来良好的用户体验。这也是匹克一直所追求的，为用户提供极致的使用体验。”</p>
            <div class="item-btm"></div>
          </div>
        </van-swipe-item>
      </van-swipe>
      <div class="btn is-active is-large" @click="handleClick2">免费体验</div>
    </div>

    <!-- over -->
    <div class="floor floor-qr">
      <img class="full-img" src="../../assets/home-h5-img/2x/矩形 copy 7@2x.png" alt />
      <div class="floor-container">
        <h3 class="floor-title color-white">1000+财务大咖在这里</h3>
        <p class="floor-desc color-white">助力100W+财务人升职加薪</p>
        <div class="ui-rela-wrapper">
          <img class="icon-qr" src="../../assets/home-h5-img/2x/二维码@2x.png" alt />
          <p class="qr-text">扫码免费领取财会黑卡</p>
          <!-- <div class="floor-container"></div> -->
        </div>
      </div>
    </div>

    <!-- over -->
    <div class="floor floor-person">
      <img class="full-img" src="../../assets/home-h5-img/2x/Mask@2x.png" alt />
      <div class="floor-container">
        <h3 class="floor-title">领取30天免费试用机会</h3>
        <p class="floor-desc">马上开始轻松管账、管货、管生意！</p>
        <span class="btn is-active is-large" @click="handleLookPop">立即免费试用</span>
      </div>
    </div>

    <!-- over -->
    <a class="floor floor-footer" v-if="showFix" href="tel:400-830-0755">电话咨询</a>

    <!-- 活动规则 -->
    <rule-popup v-model="showRulePop" />

    <!-- 登录弹窗 -->
    <LoginPopup v-model="showLoginPop" @click-login="handleLogin" @click-code="handleGetCode" />
  </div>
</template>

<script>
import Vue from 'vue';
import LoginForm from '@/components/login-form';
import LoginPopup from '@/components/login-popup';
import SuperHome from '@/components/super-home';
import { Swipe, SwipeItem } from 'vant';
Vue.use(Swipe).use(SwipeItem);

export default {
  extends: SuperHome,
  components: {
    LoginForm,
    LoginPopup
  },
  data() {
    return {
      current: 0,
      showFix: false
    };
  },
  methods: {
    handleClick2() {
      const index = this.current;
      if (index === 2 || index === 3) {
        this.handleLookPop();
      } else if (index === 0) {
        this.handleLook(this.urlMap.ykj.url);
      } else {
        this.handleLook(this.urlMap.yjxc.url);
      }
    },
    onScroll() {
      const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
      if (scrollTop > 667) {
        this.showFix = true;
      } else {
        this.showFix = false;
      }
    },
    onChange(index) {
      this.current = index;
    }
  },
  mounted() {
    window.addEventListener('scroll', this.onScroll);
  }
};
</script>

<style lang="postcss" scoped>
.view-home-h5 {
  padding-bottom: 48px;
}

.login-popup-container {
  width: 343px;
  margin: 0 auto;
  margin-top: 30%;
  background: #fff;
  .login-pop__form {
    padding-bottom: 40px;
  }
}
.color-white {
  color: #fff;
}

.ui-rela-wrapper {
  position: relative;
}

.color-primary {
  color: #f95f01;
}

.floor {
  position: relative;
  text-align: center;
  background-position: center;
}

.btn {
  display: inline-block;
  width: 115px;
  height: 32px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 32px;
  border: 1px solid #00ccc5;
  border-radius: 2px;
  color: #00ccc5;
  text-align: center;
  cursor: pointer;
  &:hover,
  &.is-active {
    color: #fff;
    background: #00ccc5;
  }
  &.is-normal {
    color: #212121;
    background: #ffffff;
    border: 1px solid #e6e6e6;
  }
  &.is-large {
    width: 288px;
    height: 40px;
    line-height: 40px;
  }
}

.floor-title {
  padding-top: 46px;
  font-size: 24px;
  text-align: center;
  line-height: 30px;
}

.floor-desc {
  margin-top: 8px;
  font-size: 14px;
  color: #666666;
  text-align: center;
  line-height: 24px;
}

.full-img {
  display: block;
  width: 100%;
}

.floor-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.login-pop {
  position: fixed;
}

.btn-rule {
  font-size: 14px;
  color: #00ccc5;
  line-height: 22px;
  margin-top: 10px;
}

.floor-banner {
  .desc {
    height: 30px;
    margin-top: 60%;
    color: #fff;
    font-size: 14px;
    line-height: 20px;
  }
  .icon-logo {
    position: absolute;
    left: 20px;
    top: 16px;
  }
  .total {
    font-family: PingFangSC-Semibold;
    font-size: 18px;
    letter-spacing: 1.23px;
  }
}

.floor-login {
  overflow: hidden;
  background: #fff;
  box-sizing: border-box;
  background: #f4f8ff;
  padding: 32px 16px;
  font-size: 14px;
  .card-box {
    height: 401px;
    margin: 0 auto;
    background: #ffffff;
    box-shadow: 0 6px 16px 0 rgba(78, 89, 123, 0.15);
    border-radius: 4px;
  }
}

.floor-resolve {
  height: 688px;
  text-align: center;
  .bg {
    opacity: 0.43;
    background-image: linear-gradient(42deg, #4461b1 0%, #759bff 18%, #b2ccff 87%);
  }
  .list {
    overflow: hidden;
    margin: 0 auto;
    padding-top: 24px;
  }
  .item {
    float: left;
    width: 43.46%;
    height: 254px;
    margin-left: 4.26%;
    margin-bottom: 24px;
    background: #ffffff;
    box-shadow: 0 10px 24px 0 rgba(48, 93, 175, 0.14);
    border-radius: 2px;
    cursor: pointer;
    transition: transform 500ms;
    box-sizing: border-box;
    &:hover {
      border: 1px solid #759bff;
    }
    p {
      font-size: 14px;
      color: #666666;
      line-height: 24px;
    }
    img {
      width: 64px;
      height: 64px;
      margin-top: 32px;
    }
    .title {
      font-family: PingFangSC-Medium;
      font-size: 16px;
      color: #212121;
      line-height: 26px;
      margin-top: 8px;
      margin-bottom: 8px;
    }
    .btn {
      margin-top: 16px;
    }
  }
}

/* 品质 */
.floor-quality {
  height: 754px;
  text-align: center;
  img {
    width: 80px;
    height: 80px;
  }
  .item {
    padding-top: 20px;
    cursor: pointer;
  }
  p {
    font-size: 14px;
    color: #666;
  }
  .title {
    margin-top: 24px;
    margin-bottom: 8px;
    font-size: 16px;
    line-height: 24px;
    color: #212121;
  }
}

/* 案例 */
.floor-custom {
  height: 680px;
  padding: 0 24px;
  text-align: center;
  background: #f4f8ff;
  .btn {
    margin-top: 24px;
  }
  .list {
    height: 430px;
    margin: 0 auto;
    margin-top: 26px;
  }
  .item {
    box-sizing: border-box;
    display: inline-block;
    height: 450px;
    text-align: left;
    background: #fff;
    cursor: pointer;
    img {
      width: 100%;
      height: 160px;
    }
    .title,
    .sub-title,
    .desc {
      font-size: 14px;
      padding: 0 24px;
      line-height: 22px;
      color: #666666;
      text-align: justify;
    }
    .title {
      font-family: PingFangSC-Medium;
      font-size: 20px;
      color: #212121;
      line-height: 30px;
      margin-top: 16px;
    }
    .sub-title {
      margin-top: 8px;
      margin-bottom: 16px;
    }
  }
}

/* 扫码 */
.floor-qr {
  color: #fff;
  .floor-desc {
    color: #fff;
  }
  .icon-qr {
    width: 210px;
    margin-top: 46px;
  }
  .floor-title {
    padding-top: 32px;
  }
  .qr-text {
    margin-top: -50px;
    color: #212121;
  }
}

/* 领取30天免费试用机会 */
.floor-person {
  color: #fff;
  .floor-desc {
    color: #fff;
  }
  .floor-title {
    padding-top: 32px;
  }
  .btn {
    margin-top: 16px;
  }
  .icon-qr {
    width: 210px;
    margin-top: 46px;
  }
}

/* 页脚 */
.floor-footer {
  z-index: 26;
  position: fixed;
  width: 100%;
  left: 0;
  bottom: 0;
  display: block;
  padding: 12px 0;
  font-size: 16px;
  line-height: 24px;
  color: #fff;
  background: #3b7ffb;
}
</style>
